<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>属性节点测试</title>
    <script type="application/javascript" src="../../static/assets/plugins/jquery/dist/jquery.js"></script>
</head>
<body>
<div id="commentBox" comment-type-data="blog_comment" comment-data="{blogId:10086}">
    <input name="button" type="button" onClick="Wopen()" value="点击我，打开新窗口!"/>
</div>
<script>
    /*用法api：https://www.cnblogs.com/amy-1205/p/5888082.html*/
    function Wopen() {
        var qqloginUrl = 'https://graph.qq.com/oauth2.0/show?which=Login&display=pc&response_type=code&client_id=101495727&redirect_uri=http%3A%2F%2Fwww.kiwipeach.cn%2Fqq%2Foauth2.0%2Fcallback&state=__kiwipeach__&scope=get_user_info&display=pc';
        // window.open(qqloginUrl,'_blank','width=800,height=600,top=100px,left=0px')
        var opt = {
            url: qqloginUrl,
            name: '三方登录窗口授权',
            iWidth: 800,
            iHeight: 400
        };
        var qqloginWindow = openwindow(opt);
        setTimeout(function () {
            qqloginWindow.close();
            window.location.reload()
            // window
        }, 3000);
    }


    function openwindow(opt) {
        // url, name, iWidth, iHeight
        var url = opt.url;                            //转向网页的地址;
        var name = opt.name;                           //网页名称，可为空;
        var iWidth = opt.iWidth;                         //弹出窗口的宽度;
        var iHeight = opt.iHeight;                        //弹出窗口的高度;
        //window.screen.height获得屏幕的高，window.screen.width获得屏幕的宽
        var iTop = (window.screen.height - 30 - iHeight) / 2;       //获得窗口的垂直位置;
        var iLeft = (window.screen.width - 10 - iWidth) / 2;        //获得窗口的水平位置;
        return window.open(url, name, 'height=' + iHeight + ',,innerHeight=' + iHeight + ',width=' + iWidth + ',innerWidth=' + iWidth + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
    }

</script>
</body>
</html>